package cn.itsource.autoconfig;

import cn.itsource.pojo.properties.WechatProperties;
import cn.itsource.template.WechatTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 📖：beishan
 * 🗓️：2024/3/29 16:12
 * =====================
 */
@Configuration //配置类
@EnableConfigurationProperties({WechatProperties.class}) //配置文件数据读取
public class WechatAutoConfiguration {
    @Bean
    public RestTemplate RestTemplate() {
        return new RestTemplate();
    }

    @Bean
    public WechatTemplate wechatTemplate(WechatProperties wechatProperties,RestTemplate restTemplate) {

        return new WechatTemplate(wechatProperties,restTemplate);
    }

}
